04. Scalar Multiplication of Matrix and Quiz

Scalar Multiplication of Matrix

To multiply a matrix by a scalar, we do not need to verify

  • Dimensions
    or
  • Indices

Simply multiply each element in the matrix by the scalar!

For example:

αA=[αa11αa12αa13..αa1nαa21αa22αa23..αa2nαa31αa32αa33..αa3n:αam1αam2αam3αamn]\alpha A=\begin{bmatrix} \alpha a_{11} &\alpha a_{12} &\alpha a_{13}&..& \alpha a_{1n}\\ \alpha a_{21} &\alpha a_{22} &\alpha a_{23}&..&\alpha a_{2n}\\\alpha a_{31} &\alpha a_{32} &\alpha a_{33}&..&\alpha a_{3n}\\ :\\\alpha a_{m1} &\alpha a_{m2} &\alpha a_{m3}&……&\alpha a_{mn}\end{bmatrix}

Equation 13

Quiz

What is the value of the ij{ij}th element of Matrix DD if:

D=0.2A+(5)B2CD=0.2A+(-5)B-2C

a. i=1i=1, j=1j=1

b. i=2i=2, j=4j=4

A=[30.6431.3408.67080.006]A=\begin{bmatrix} 3 &0.6 &4&-3\\ -1.3 &4 &0&8.6\\7&0 &-8& 0.006\end{bmatrix}

B=[35.76450221.399001]B=\begin{bmatrix} 3 &-5.76 &45&0\\ 2 &-2 &1.3&9\\-9&0 &0& 1\end{bmatrix}

C=[0100966.7849900540.070000]C=\begin{bmatrix} 0 &1009 &-66.7849&90\\ 0 &5 &4&-0.07\\0&0 &0& 0\end{bmatrix}

Code

If you need a code on the https://github.com/udacity.

Notice that the equation: D=0.2A+(5)B2CD=0.2A+(-5)B-2C represents a linear combination of matrices and scalars.